<%--
  @desc: 应用系统角色新增
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    .pageFormContent .textInput { width: 220px; }
</style>
<script type="text/javascript">
</script>
<div class="pageContent">
    <form id="pagerForm" method="post" action="<c:url value='/sys/dict/new'/>" class="pageForm required-validate"
          onsubmit="return validateCallback(this,callbackForSubmit)">
        <div class="pageFormContent">
            <p>
                <label for="txt_dict_title">字典标题</label>
                <input id="txt_dict_title" type="text" name="title" class="required" maxlength="300" value=""/>
            </p>
            <p>
                <label for="text_dict_show">字典所属</label>
                <input id="text_dict_show" type="text" readonly=readonly class="required" value="${dict.title}">
                <input id="text_dict_pid" type="hidden" name="parentId" class="required" maxlength="300" value="${dict.id}">
            </p>
            <p>
                <label for="txt_dict_key">关键字</label>
                <input id="txt_dict_key" type="text" name="key" class="required" maxlength="300"/>
            </p>
            <p>
                <label for="txt_dict_val">字典内容</label>
                <input id="txt_dict_val" type="text" name="val" class="required" maxlength="300"/>
            </p>
            <p>
                <label for="txt_dict_remark">备注信息</label>
                <input id="txt_dict_remark" type="text" name="remark" class="required" maxlength="300"/>
            </p>
            <p>
                <label for="txt_dict_sort">排序</label>
                <input id="txt_dict_sort" type="text" name="sort" class="required numberbox" maxlength="4"/>
            </p>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">保存</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
    function callbackForSubmit(resp, st, xhr) {
        if (resp && resp.succ) {
            alertMsg.info("新增成功！");
            $.pdialog.closeCurrent();
            navTab.reloadFlag('page_sys_dict_list')
        } else {
            alertMsg.info(resp.msg + "!");
        }
    }
    //新添加后暂时添加树结构并更新
    function updateZTreeAndList() {
        //字典标题
        <%--var title = $("#txt_dict_title").val();--%>
        <%--var id=$("#txt_dict_")--%>
        <%--//刷新列表--%>
        <%--$("#dict_list").loadUrl("<c:url value='/sys/dict/sub/#'/>".replace("#", "${dict.parentId}"));--%>
        <%--//获取改变节点--%>
        <%--var changeNode = zTree.getNodesByParam("id", id, null)[0];--%>
        <%--//更改节点名称--%>
        <%--changeNode.name = title;--%>
        <%--//更新节点--%>
        <%--zTree.updateNode(changeNode);--%>
    }
</script>